<?php
class R2Storage_Form_Element_TestButton extends Typecho\Widget\Helper\Form\Element
{
    public function input(?string $name = null, ?array $options = null): ?Typecho\Widget\Helper\Layout
    {
        return new Typecho\Widget\Helper\Layout('button', [
            'id' => 'testButton',
            'class' => 'btn primary',
            'type' => 'button'
        ], _t('测试连接'));
    }

    protected function inputValue($value) { return null; }
}

class R2Storage_Form_Element_LogButton extends Typecho\Widget\Helper\Form\Element
{
    public function input(?string $name = null, ?array $options = null): ?Typecho\Widget\Helper\Layout
    {
        return new Typecho\Widget\Helper\Layout('a', [
            'href' => Typecho\Common::url('/action/R2Storage-logs', 
                Typecho\Widget::widget('Widget_Options')->index),
            'class' => 'btn',
            'target' => '_blank'
        ], _t('查看日志'));
    }

    protected function inputValue($value) { return null; }
}